package com.woniuxy.microsystemuapserver.controller;

import com.woniuxy.microsystemuapserver.bean.DeptBean;
import com.woniuxy.microsystemuapserver.bean.ResultMsg;
import com.woniuxy.microsystemuapserver.service.DeptService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: huhenggg
 * @Date: 2021/1/25 0025 下午 4:33
 */
@RestController
@RequestMapping("/dept")
public class DeptController {

    @Resource
    private DeptService deptServiceImpl;

    /**
     * 查询所有部门信息
     * @return
     */
    @GetMapping("/all")
    public List<DeptBean> findAllDept() {
       return deptServiceImpl.findAllDept();
    }

    /**
     * 更新部门操作
     * @param deptBean
     * @return
     */
    @GetMapping("/update")
    public ResultMsg updateDeptInfo(DeptBean deptBean) {
        deptServiceImpl.updateDeptBean(deptBean);
        return null;
    }

    @PostMapping("/more")
    public ResultMsg addDeptInfo(DeptBean deptBean) {

        return null;
    }


}
